# -*- coding: utf-8 -*-
"""
    apps.clubes.views.classificacao
    ~~~~~~~~~~~~~~

    A brief description goes here.

    :copyright: (c)  27/06/2012  by arruda.
    :license: LICENSE_NAME, see LICENSE_FILE for more details.
"""
import operator
from django.shortcuts import get_object_or_404, redirect
from annoying.decorators import render_to
from clubes.models import Clube

@render_to('classificacao.html')
def classificacao(request):     
    
    x = {1: 2, 3: 4, 4:3, 2:1, 0:0}
    sorted_x = sorted(x.iteritems(), key=operator.itemgetter(1))
    
    clubes = Clube.objects.filter(partidas_mandante__gte=1).distinct()
    return locals()
